package com.young.fragments.demo.activity_result_launcher_demo

import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.activity.result.ActivityResult
import androidx.activity.result.ActivityResultCallback
import androidx.activity.result.ActivityResultLauncher
import com.young.fragments.databinding.ActivityActivityResultLauncher1Binding
import com.young.fragments.databinding.ActivityActivityResultLauncherBinding
import com.young.fragments.demo.activity_result_launcher_demo.fm.ActivityResultLauncherFragment
import com.young.lib_fragments.acs.BaseActivity

/**
 * @author huangzehui
 * @date 2025/1/26 22:23 周日
 * @description registerForActivityResult 的使用例子，就是 startActivityForResult 的代替
 */
class ActivityResultLauncher1Activity : BaseActivity() {


    private val mBinding by lazy {
        ActivityActivityResultLauncher1Binding.inflate(layoutInflater)
    }


    override fun getFragmentContainerId(): Int {
        return mBinding.flFmContainer.id
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(mBinding.root)

        start(
            fm = ActivityResultLauncherFragment(),
            isToBackStack = false,
        )
    }


}